package cn.tedu.charging.device.controller;

import cn.tedu.charging.common.pojo.param.GunStatusUpdateParam;
import cn.tedu.charging.common.web.JsonResult;
import cn.tedu.charging.common.pojo.vo.StationInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/device")
@Api(tags = "设备场站相关接口")
public class StationController {
    @ApiOperation("获取场站信息")
    @GetMapping("/station/info/{gunId}")
    public JsonResult createOrder(@PathVariable("gunId") Integer gunId) {
        log.debug("获取场站信息:{}", gunId);
        StationInfoVO vo = new StationInfoVO();
        vo.setOperatorId(1);
        vo.setStationId(1);
        log.debug("返回场站信息:{}", vo);
/*        JsonResult jsonResult = new JsonResult();
        jsonResult.setData(vo);
        jsonResult.setCode(2000);*/
        return JsonResult.ok(vo);
    }

    @ApiOperation("更新枪的状态")
    @PostMapping("/station/gun/status/update")
    public JsonResult updateGunStatus(GunStatusUpdateParam gunStatusUpdateParam) {
        log.debug("更新枪的状态:{}", gunStatusUpdateParam);
        return JsonResult.ok(true);
    }
}
